
using System;
using System.Collections.Generic;
using HousingInfo.DataLinQ;
using Csla.Data;
using System.Linq;
using Csla;

namespace HousingInfo.Library
{ 
	public partial class AreaDetailBOList : Csla.BusinessListBase<AreaDetailBOList, AreaDetailBO>
    {
        #region Trang Areas
        #region Kiem Tra Con Ton Tai khu vuc con khi xoa khu vuc cha
        public static bool CheckAreaDetailinArea(int areaID)
        {
            int count = 0;
            using (var mgr = ContextManager<HousingInfoDataContext>
                    .GetManager(Database.HousingInfoConnection))
            {
                count = mgr.DataContext.AreaDetails.Count(n => n.AreaID == areaID);
            }

            return (count > 0);
        }
        #endregion //Kiem Tra
        #endregion //Area
    }
}
